package cz.muni.fi.pb138.videoweb2013.backend;

import java.util.List;

/**
 * 
 * 
 * @author Lenka Kunikova
 * @since 2013-05-05
 */
public interface MediumManager {
    
    /**
     * Add new medium into category
     * @param Medium 
     * @return int generated id of added medium  
     */    
    public int addRecord(Medium z);
    
    /**
     * Delete the specified medium from database
     * @param Medium 
     * 
     */    
    public void deleteRecord(Medium z);
    
    /**
     * Update specified medium. 
     * Using id, the medium will be find in database 
     * and its values will be changed to correspond with the medium in paramater.
     * @param Medium 
     * 
     */    
    public void updateRecord(Medium z);
    
    /**
     * return all media currently present in database
     * 
     * @return List<Medium> 
     */
    public List<Medium> getAll();
    /**
     * Return all categories currently present in database
     * 
     * @return List<Category>   
     */
    public List<Category> getCategories();
    
    /**
     * Function is looking for specified string in text nodes of every record
     * and return all media witch contains record where the string was find
     * @param String String we want to find, probably the name of film 
     * @return int generated id of added medium  
     */
    public List<Medium> getMediumByString(String s);
    
    /**
     * return the medium with specified id
     * @param int  
     * @return Medium   
     */
    public Medium getMediumById(int id);
    
    /**
     * Function return all content of database (complete xml) like a string
     * 
     * @return String 
     */
    public String getXML();
    
    /**
     * Remove the content of database,
     * all categories and media.
     * Basic structure will be preserved.
     * 
     */
    public void clearDatabase();
   
}

